package com.totoro.tymapping.executor.condition;

import com.totoro.tymapping.utils.StrUtil;
import com.totoro.tymapping.utils.TagUtil;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

/**
 * @author Totoro
 * @version 0.1.0
 * @date 2025/8/13 - 15:28
 * @description
 **/
public interface ConditionExecutor {

    default String getFinalCondition(String originalCondition, String conditionType) {
        return TagUtil.getTagContent(StrUtil.getPrefixAfter(originalCondition, conditionType));
    }

    /**
     * @author totoro
     * @description 执行解析
     * @date  15:35
     * @param condition, player, matchItem - 只有name和lore条件会用到itemMatch
     * @return java.lang.Boolean
     **/
    Boolean execute(String condition, Player player, ItemStack matchItem);
}
